// vuex中储存登录信息

// 引入token库文件
import { getToken, setToken, removeToken } from '@/utils/storage.js'

const state = {
  tokenInfo: getToken() || {}
}
const mutations = {
  setToken (state, token) {
    state.tokenInfo = token
    setToken(token)
  },
  removeToken (state) {
    state.tokenInfo = {}
    removeToken()
  }
}
const getters = {}
const actions = {}
export default {
  namespaced: true,
  state,
  mutations,
  getters,
  actions

}
